<template>
  <el-container style="height: 100vh;">
<!--    左侧菜单栏-->
    <el-aside :width="sideWidth+'px'" style="background-color: rgb(238, 241, 246); height: 100%; box-shadow: 2px 0 6px rgb(0 21 41 / 35%)">
      <Aside :is-collapse="isCollapse" :logo-text-show="logoTextShow"></Aside>
    </el-aside>
    <el-container>
      <el-header style=" border-bottom: 1px solid #ccc">
        <Header :collapse-btn-class="collapseBtnClass" :collapse="collapse"></Header>
      </el-header>

      <el-main style="height: 100%">
        <router-view/>
      </el-main>

    </el-container>
  </el-container>
</template>

<script>
// @ is an alias to /src
import Aside from "@/components/Aside";
import Header from "@/components/Header";

export default {
  name: 'ManageView',
  data() {
    return {
      collapseBtnClass: 'el-icon-s-fold',
      isCollapse: false, // isCollapse = false 左边菜单栏展开
      sideWidth: 200,
      //  左侧菜单栏系统名称是否显示
      logoTextShow: true,
    }
  },
  components: {
    Aside,
    Header
  },
  created() {
    // this.validToken()
  },
  methods: {
    collapse(){
      this.isCollapse = !this.isCollapse
      // 当菜单栏收缩时，调整宽度
      if (this.isCollapse){
        this.sideWidth = 64
        this.collapseBtnClass = 'el-icon-s-unfold'
        this.logoTextShow = false
      }else{
        this.sideWidth = 200
        this.collapseBtnClass = 'el-icon-s-fold'
        this.logoTextShow = true
      }
    },
    validToken(){
      this.request.get("/user/validateToken")
    }
  }
}
</script>
